package com.example.windowdemo.window.decorator;

import android.content.Context;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;

import com.example.windowdemo.window.Window;

/**
 * @author: njb
 * @date: 2023/8/2 17:53
 * @desc: 装饰器模式
 */
public class WindowDecorator<T> extends Window<T> {
    private static final String TAG = "WindowDecorator";

    public WindowDecorator(Context context) {
        super(context);
    }

    @Override
    public void setData(T data) {
        super.setData(data);
        Log.d(TAG, "setData() called with data: " + data);
    }

    @Override
    public void addView(View view) {
        super.addView(view);
        Log.d(TAG, "addView() called with view: " + view);
    }

    @Override
    public boolean dispatchKeyEvent(KeyEvent keyEvent) {
        Log.d(TAG, "dispatchKeyEvent() called with keyEvent: " + keyEvent);
        return super.dispatchKeyEvent(keyEvent);
    }


}
